package com.example.demo.gateway.repository;

import com.example.demo.gateway.entity.GatewayRoute;
import com.example.demo.gateway.entity.GatewayUpstream;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@Repository
public interface GatewayUpstreamRepository extends ReactiveCrudRepository<GatewayUpstream, Long> {

    // additional custom query methods go here
    @Query("SELECT * FROM gateway_upstream LIMIT :page,:size")
    Flux<GatewayUpstream> findPage(int page, int size);

    Flux<GatewayUpstream> findByServiceId(String serviceId);
}